<template>
  <div class="">
    <div class="crumbs">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item><i class="el-icon-lx-copy"></i> 消息中心</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="container">
      <el-table :data="msgList"
                :show-header="false"
                style="width: 100%">
        <el-table-column width="180">
          <template slot-scope="scope">
            <span class="message-title">{{scope.row.title}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="message"
                         min-width="180"></el-table-column>
        <el-table-column width="120">
          <template slot-scope="scope">
            <el-button size="small"
                       type="danger"
                       @click="removeMsgIndex(scope.$index)">移除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div class="handle-row">
        <el-button type="danger"
                   @click="removeMsgAll()">全部移除</el-button>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
export default {
  name: 'tabs',
  data () {
    return {

    }
  },
  computed: {
    ...mapState(["msgList"]),
  },
  methods: {
    ...mapMutations(["removeMsgIndex", "removeMsgAll"]),

  },

}

</script>

<style>
.message-title {
    cursor: pointer;
}
.handle-row {
    margin-top: 30px;
}
</style>

